//-----------------------------------------------------------------------
// <copyright file="BannerSizeService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class BannerSizeService
    {
        #region BannerSize

        public static void CreateBannerSize(BannerSize bannerSize)
        {            
            try
            {
                BannerSizeDAO bannerSizeDAO = new BannerSizeDAO();
                bannerSizeDAO.CreateBannerSize(bannerSize);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateBannerSizeException, ex);
            }
        }        

        public static void UpdateBannerSize(BannerSize bannerSize)
        {            
            try
            {
                BannerSizeDAO bannerSizeDAO = new BannerSizeDAO();
                bannerSizeDAO.UpdateBannerSize(bannerSize);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateBannerSizeException, ex);
            }
        }        

        public static void DeleteBannerSize(long sizeId)
        {            
            try
            {
                BannerSizeDAO bannerSizeDAO = new BannerSizeDAO();
                bannerSizeDAO.DeleteBannerSize(sizeId);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteBannerSizeException, ex);
            }
        }
        
        public static BannerSize GetBannerSize(long sizeId)
        {            
            try
            {
                BannerSizeDAO bannerSizeDAO = new BannerSizeDAO();
                return bannerSizeDAO.GetBannerSize(sizeId);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerSizeException, ex);
            }
        }                

        public static BannerSizeCollection GetBannerSizeList(BannerSizeColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                BannerSizeDAO bannerSizeDAO = new BannerSizeDAO();
                return bannerSizeDAO.GetBannerSizeList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerSizeListException, ex);
            }
        }        

        public static BannerSizeCollection GetBannerSizeList(BannerSizeColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                BannerSizeDAO bannerSizeDAO = new BannerSizeDAO();
                return bannerSizeDAO.GetBannerSizeList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerSizeListException, ex);
            }
        }        

	    public static BannerSizeCollection GetBannerSizeListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                BannerSizeDAO bannerSizeDAO = new BannerSizeDAO();
                return bannerSizeDAO.GetBannerSizeListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerSizeListException, ex);
            }
        }        

        public static BannerSizeCollection GetBannerSizeListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                BannerSizeDAO bannerSizeDAO = new BannerSizeDAO();
                return bannerSizeDAO.GetBannerSizeListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerSizeListException, ex);
            }
        }        

        #endregion
    }
}